﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNet.Common.NHibernateUtil;
using NHibernate;
using ZLCMS.Data.Model;

namespace ZLCMS.Web.Wap.Member
{
    public partial class MessageList : ZLCMS.Web.Wap.Code.MemberPageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!(string.IsNullOrEmpty(Request["id"])))
            {
                using (ISession session = SessionFactoryHelper.CreateSession())
                {
                    MemberMsgKind msgKind = session.Get<MemberMsgKind>(Int32.Parse(Request["id"]));
                    if (msgKind.Kind != Request["k"] || msgKind.MemberAccount != CurrentMemberAccount)
                    {
                        Server.Transfer("/wap/member/messageindex.aspx");
                    }
                    else
                    {
                        msgKind.Status = "1";
                        session.Update(msgKind);
                        session.Flush();
                    }
                }
            }
        }
    }
}